package com.hellomvp.client.mapper;

import com.google.gwt.activity.shared.Activity;
import com.google.gwt.activity.shared.ActivityMapper;
import com.google.gwt.place.shared.Place;
import com.hellomvp.client.activity.RightPanelGoodbyeActivity;
import com.hellomvp.client.place.GoodbyePlace;
import com.hellomvp.client.place.HelloPlace;
import com.hellomvp.client.ClientFactory;
import com.hellomvp.client.activity.RightPanelHelloActivity;

public class RightPanelActivityMapper implements ActivityMapper {
	private ClientFactory clientFactory;
	
	public RightPanelActivityMapper(ClientFactory clientFactory) {
		super();
		this.clientFactory = clientFactory;
	}

	@Override
	public Activity getActivity(Place place) {
		if (place instanceof HelloPlace)
			return new RightPanelHelloActivity((HelloPlace) place, clientFactory);
		else if (place instanceof GoodbyePlace)
			return new RightPanelGoodbyeActivity(clientFactory);
		return null;
	}
}
